package com.pti.fsc.api.service.${entityName?lower_case}.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.pti.util.log.Logger;

public class ${entityName}DaoImpl extends SetupBaseDao implements ${entityName}Dao {

	private static Logger logger = Logger.getInstance(${entityName}DaoImpl.class.getName());
	
	/**
	 * SQL error code.
	 */
	private static final String SQL_ERROR = "global.error.sql-error";
	
	private static ${entityName}Dao instance = new ${entityName}DaoImpl();
	/**
	 * get the instance
	 * @return
	 */
	public static ${entityName}Dao getInstance() {
		return (instance);
	}
	private ${entityName}DaoImpl() {
		super();
	}
	
	private void setTimeStamp(int index,PreparedStatement stmt,Date date) throws SQLException{
		if (date != null) {
			Timestamp Timestamp = new Timestamp(date.getTime());
			stmt.setTimestamp(index,Timestamp,DateUtil.getGMTCalendar());
		} else {
			stmt.setNull(index, Types.TIMESTAMP);
		}
	}
	
}
